package com.hb.trade.server.project.opening.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hb.core.pojo.project.opening.entity.BidOpeningSchedule;
import com.hb.core.pojo.project.opening.mapper.BidOpeningScheduleMapper;
import com.hb.trade.server.project.opening.service.BidOpeningScheduleService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 开标一览表 服务实现类
 * </p>
 *
 * @author zhongdl
 * @since 2021-09-17
 */
@Service
public class BidOpeningScheduleServiceImpl extends ServiceImpl<BidOpeningScheduleMapper, BidOpeningSchedule> implements BidOpeningScheduleService {

    @Override
    public List<BidOpeningSchedule> listByFileId(Long fileId) {
        QueryWrapper<BidOpeningSchedule> wrapper =
                BidOpeningSchedule.wrapper("id,bid_opening_name,unit_name,fill_type,sort_num,tpl_flag");
        wrapper.eq("file_id", fileId).orderByAsc("sort_num");
        return list(wrapper);
    }

    /**
     *
     * @param sectionId
     * @return
     */
    @Override
    public List<BidOpeningSchedule> listBySectionId(Long sectionId) {
        List<BidOpeningSchedule> listBidOpeningSchedule = baseMapper.listBySectionId(sectionId);
        return listBidOpeningSchedule;
    }
}
